let uiNode = null;
const BaseView = require('./BaseView')

module.exports = {
    setUINode(node) {
        uiNode = node;
    },

    openUI(name, params) {
        console.log('openUI', name)
        cc.resources.load(`prefab/huazhuang/mini/${name}`, cc.Prefab, (err, asset) => {
            let node = cc.instantiate(asset);
            let base = node.getComponent(BaseView.default)
            if(base){
                base.params = params;
            }
            uiNode.addChild(node);
        })
    }
}
;
